package com.wsx.boots.auth.config;

import org.apache.shiro.authc.AuthenticationToken;

import java.util.Map;

/**
 * Created by wangshuaixin on 17/4/23.
 */
public class StatelessAuthenticationToken implements AuthenticationToken {

    private static final long serialVersionUID = -7996107756663210286L;

    private String name;
    private Map<String, ?> params;
    private String clientDigest;

    public StatelessAuthenticationToken() {}

    public StatelessAuthenticationToken(String name, Map<String, ?> params, String clientDigest) {
        super();
        this.name = name;
        this.params = params;
        this.clientDigest = clientDigest;
    }

    public StatelessAuthenticationToken(String name, String clientDigest) {
        super();
        this.name = name;
        this.clientDigest = clientDigest;
    }

    @Override
    public Object getPrincipal() {
        return name;
    }

    @Override
    public Object getCredentials() {
        return clientDigest;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, ?> getParams() {
        return params;
    }

    public void setParams(Map<String, ?> params) {
        this.params = params;
    }

    public String getClientDigest() {
        return clientDigest;
    }

    public void setClientDigest(String clientDigest) {
        this.clientDigest = clientDigest;
    }
}
